package cn.alusiaor.eurekaclientarticleservice.exception;

/**
 * @author zhuzhiping
 * @description 自定义业务异常
 * @date 2021/2/3 11:00
 */

public class CustomException extends RuntimeException {

    /**
     * 异常码
     */
    private Integer code;

    /**
     * 异常消息
     */
    private String msg;


    public CustomException(CustomExceptionResponseAdapter customExceptionResponse) {
        this.msg = customExceptionResponse.getMsg();
        this.code = customExceptionResponse.getCode();
    }

    public CustomException(Integer code ,String msg) {
        this.msg =msg;
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
